const state = {
    tree_selected_obj: [],
    // wrapObj: {}
  };
  
  const getters = {};
  
  const mutations = {
      addTaskArr: (state, data) => {
        var obj = {}
          let { label, chns, sn, parent_label } = data;
            obj["sn"] = sn;
            obj["device_name"] = parent_label ? parent_label : label;
            //obj["channel"] = typeof chns == 'number' ? chns.toString() : '';
            obj["channel"] = chns;
          state.tree_selected_obj = obj
            // state.wrapObj[obj['device_name'] + obj['sn']] = 1
      },
    //   initTaskArr: (state, data) => {
    //       state.tree_selected_arr = data
    //   },
    //   removeTaskArr: (state, data) => {
    //       state.tree_selected_arr.splice(data.index, 1)
    // },
  };
  
  const actions = {};
  
  export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
  };